+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
+Wed Dec 16 13:06:17 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main
+ thread lock back to GDK - we need it there for locking
+ when translating events. Rename things appropriately.
+
+Wed Dec 16 11:44:21 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo.
+
Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GTK+ 1.1.8
if (gdk_initialized)
return;
+ if (g_thread_supported ())
+ gdk_threads_mutex = g_mutex_new ();
+
if (argc && argv)
{
argc_orig = *argc;
}
return TRUE;
}
+
+void
+gdk_threads_enter ()
+{
+ GDK_THREADS_ENTER ();
+}
+
+void
+gdk_threads_leave ()
+{
+ GDK_THREADS_LEAVE ();
+}
+
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
+/* Threading
+ */
+
+extern GMutex *gdk_threads_mutex;
+
+void gdk_threads_enter (void);
+void gdk_threads_leave (void);
+
+#ifdef G_THREADS_ENABLED
+# define GDK_THREADS_ENTER() G_STMT_START { \
+ if (gdk_threads_mutex) \
+ g_mutex_lock (gdk_threads_mutex); \
+ } G_STMT_END
+# define GDK_THREADS_LEAVE() G_STMT_START { \
+ if (gdk_threads_mutex) \
+ g_mutex_unlock (gdk_threads_mutex); \
+ } G_STMT_END
+#else /* !G_THREADS_ENABLED */
+# define GDK_THREADS_ENTER()
+# define GDK_THREADS_LEAVE()
+#endif /* !G_THREADS_ENABLED */
#include <gdk/gdkrgb.h>
GTimeVal *current_time,
gint *timeout)
{
+ gboolean retval;
+
+ GDK_THREADS_ENTER ();
+
*timeout = -1;
gdk_events_queue ();
- return (queued_events || putback_events);
+ retval = (queued_events || putback_events);
+
+ GDK_THREADS_LEAVE ();
+
+ return retval;
}
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time)
{
+ gboolean retval;
+
+ GDK_THREADS_ENTER ();
+
if (event_poll_fd.revents & G_IO_IN)
gdk_events_queue ();
- return (queued_events || putback_events);
+ retval = (queued_events || putback_events);
+
+ GDK_THREADS_LEAVE ();
+
+ return retval;
}
static GdkEvent *
GTimeVal *current_time,
gpointer user_data)
{
- GdkEvent *event = gdk_event_unqueue();
+ GdkEvent *event;
+
+ GDK_THREADS_ENTER ();
+
+ event = gdk_event_unqueue();
if (event)
{
gdk_event_free (event);
}
+ GDK_THREADS_LEAVE ();
+
return TRUE;
}
* x pointer grab
*/
+GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
+
#ifdef USE_XIM
GdkICPrivate *gdk_xim_ic; /* currently using IC */
GdkWindow *gdk_xim_window; /* currently using Window */
GTimeVal *current_time,
gint *timeout)
{
+ gboolean retval;
+
+ GDK_THREADS_ENTER ();
+
*timeout = -1;
gdk_events_queue ();
- return (queued_events || putback_events);
+ retval = (queued_events || putback_events);
+
+ GDK_THREADS_LEAVE ();
+
+ return retval;
}
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time)
{
+ gboolean retval;
+
+ GDK_THREADS_ENTER ();
+
if (event_poll_fd.revents & G_IO_IN)
gdk_events_queue ();
- return (queued_events || putback_events);
+ retval = (queued_events || putback_events);
+
+ GDK_THREADS_LEAVE ();
+
+ return retval;
}
static GdkEvent *
GTimeVal *current_time,
gpointer user_data)
{
- GdkEvent *event = gdk_event_unqueue();
+ GdkEvent *event;
+
+ GDK_THREADS_ENTER ();
+
+ event = gdk_event_unqueue();
if (event)
{
gdk_event_free (event);
}
+ GDK_THREADS_LEAVE ();
+
return TRUE;
}
* x pointer grab
*/
+GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
+
#ifdef USE_XIM
GdkICPrivate *gdk_xim_ic; /* currently using IC */
GdkWindow *gdk_xim_window; /* currently using Window */
if (gdk_initialized)
return;
+ if (g_thread_supported ())
+ gdk_threads_mutex = g_mutex_new ();
+
if (argc && argv)
{
argc_orig = *argc;
}
return TRUE;
}
+
+void
+gdk_threads_enter ()
+{
+ GDK_THREADS_ENTER ();
+}
+
+void
+gdk_threads_leave ()
+{
+ GDK_THREADS_LEAVE ();
+}
+
#include "gtkmain.h"
#include "gtksignal.h"
#include "gtkaccellabel.h"
-#include "gtkprivate.h"
enum {
{
gboolean retval;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
retval = gtk_accel_label_refetch (accel_label);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
#include "gtkclist.h"
#include "gtkbindings.h"
#include "gtkdnd.h"
-#include "gtkprivate.h"
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
GdkEventMotion event;
GdkModifierType mask;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
clist->htimer = 0;
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
gtk_clist_motion (GTK_WIDGET (clist), &event);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
GdkEventMotion event;
GdkModifierType mask;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
clist->vtimer = 0;
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
gtk_clist_motion (GTK_WIDGET (clist), &event);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
#include "gtkwindow.h"
#include "gtkhbbox.h"
#include "gtkdnd.h"
-#include "gtkprivate.h"
#include "gtkselection.h"
/*
{
gint x, y;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
gdk_window_get_pointer (colorsel->value_area->window, &x, &y, NULL);
gtk_color_selection_update_value (colorsel, y);
gtk_color_selection_color_changed (colorsel);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return (TRUE);
}
#include "gtklistitem.h"
#include "gtkscrolledwindow.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtksignal.h"
#include "gtkwindow.h"
#include "gdk/gdkkeysyms.h"
{
if (combo)
{
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
gtk_widget_grab_focus (combo->entry);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
}
return FALSE;
}
static gboolean
gtk_container_idle_sizer (gpointer data)
{
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
/* we may be invoked with a container_resize_queue of NULL, because
* queue_resize could have been adding an extra idle function while
gtk_container_check_resize (GTK_CONTAINER (widget));
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
#include "gtkdnd.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtksignal.h"
#include "gtkwindow.h"
gint x, y;
gboolean retval;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
if (anim->step == anim->n_steps)
{
retval = TRUE;
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
#include "gdk/gdki18n.h"
#include "gtkentry.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkselection.h"
#include "gtksignal.h"
#include "gtkstyle.h"
{
GtkEntry *entry;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
entry = GTK_ENTRY (data);
entry->timer = 0;
gtk_entry_draw_text (entry);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
tmp_list = tmp_list->next;
}
+
+ if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+ (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
}
static void
#include "gtklist.h"
#include "gtklistitem.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtksignal.h"
#include "gtklabel.h"
GdkEventMotion event;
GdkModifierType mask;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
GTK_LIST (list)->htimer = 0;
gdk_window_get_pointer (list->window, &x, &y, &mask);
gtk_list_motion_notify (list, &event);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
GdkEventMotion event;
GdkModifierType mask;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
GTK_LIST (list)->vtimer = 0;
gdk_window_get_pointer (list->window, &x, &y, &mask);
gtk_list_motion_notify (list, &event);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
guint gtk_debug_flags = 0; /* Global GTK debug flag */
-GMutex *gtk_threads_mutex = NULL; /* Global GTK lock */
-
#ifdef G_ENABLE_DEBUG
static const GDebugKey gtk_debug_keys[] = {
{"objects", GTK_DEBUG_OBJECTS},
* single threaded until gtk_init().
*/
- if (g_thread_supported ())
- gtk_threads_mutex = g_mutex_new ();
-
#if 0
g_set_error_handler (gtk_error);
g_set_warning_handler (gtk_warning);
loop = g_main_new ();
main_loops = g_slist_prepend (main_loops, loop);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
g_main_run (loop);
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
g_main_destroy (loop);
}
}
-void
-gtk_threads_enter ()
-{
- GTK_THREADS_ENTER ();
-}
-
-void
-gtk_threads_leave ()
-{
- GTK_THREADS_LEAVE ();
-}
-
#if 0
static void
gtk_error (gchar *str)
GdkEvent* gtk_get_current_event (void);
GtkWidget* gtk_get_event_widget (GdkEvent *event);
-void gtk_threads_enter (void);
-void gtk_threads_leave (void);
-
/* deprecated */
guint gtk_idle_add_interp (GtkCallbackMarshal marshal,
gpointer data,
#include <string.h>
#include "gtkaccellabel.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkmenu.h"
#include "gtkmenubar.h"
#include "gtkmenuitem.h"
{
GtkMenuItem *menu_item;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
menu_item = GTK_MENU_ITEM (data);
menu_item->timer = 0;
gtk_menu_shell_select_item (submenu, submenu->children->data);
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
#include "gtknotebook.h"
#include "gtksignal.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
#include "gtklabel.h"
{
gboolean retval = FALSE;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
if (notebook->timer)
{
retval = TRUE;
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
#define GTK_PRIVATE_SET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) |= (PRIVATE_ ## flag)); }G_STMT_END
#define GTK_PRIVATE_UNSET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) &= ~(PRIVATE_ ## flag)); }G_STMT_END
-/* Threading functions */
-
-extern GMutex *gtk_threads_mutex;
-
-#ifdef G_THREADS_ENABLED
-# define GTK_THREADS_ENTER() G_STMT_START { \
- if (gtk_threads_mutex) \
- g_mutex_lock (gtk_threads_mutex); \
- } G_STMT_END
-# define GTK_THREADS_LEAVE() G_STMT_START { \
- if (gtk_threads_mutex) \
- g_mutex_unlock (gtk_threads_mutex); \
- } G_STMT_END
-#else /* !G_THREADS_ENABLED */
-# define GTK_THREADS_ENTER()
-# define GTK_THREADS_LEAVE()
-#endif /* !G_THREADS_ENABLED */
-
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include <stdio.h>
#include "gtkmain.h"
#include "gtkrange.h"
-#include "gtkprivate.h"
#include "gtksignal.h"
(event->area.x + event->area.width <=
widget->allocation.width - xt) &&
(event->area.y + event->area.height <=
- widget->allocation.height - xt)))
+ widget->allocation.height - yt)))
gtk_range_draw_trough (range);
}
else if (event->window == widget->window)
{
- gtk_range_draw_background (range);
+ gtk_range_draw_background (range);
}
else if (event->window == range->slider)
{
{
gint return_val;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
return_val = TRUE;
if (range->click_child == RANGE_CLASS (range)->slider)
(gpointer) range);
else
{
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
range->need_timer = FALSE;
return_val = gtk_range_scroll (range, -1);
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return return_val;
}
#include <gdk/gdkx.h>
/* we need this for gdk_window_lookup() */
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkselection.h"
#include "gtksignal.h"
GList *tmp_list;
gboolean retval;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
/* Determine if retrieval has finished by checking if it still in
list of pending retrievals */
retval = TRUE; /* timeout will happen again */
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
GList *tmp_list;
gboolean retval;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
/* Determine if retrieval has finished by checking if it still in
list of pending retrievals */
retval = TRUE; /* timeout will happen again */
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
#include "gdk/gdkkeysyms.h"
#include "gtkspinbutton.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtksignal.h"
{
gboolean retval = FALSE;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
if (spin_button->timer)
{
}
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return retval;
}
#include "gtkthemes.h"
#include "gtkwidget.h"
#include "gtkthemes.h"
-#include "gtkprivate.h"
#include "gdk/gdkprivate.h"
#include "gdk/gdkkeysyms.h"
#include "gdk/gdki18n.h"
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkselection.h"
#include "gtksignal.h"
#include "gtktext.h"
gint x, y;
GdkModifierType mask;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
text = GTK_TEXT (data);
gtk_text_motion_notify (GTK_WIDGET (text), &event);
}
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
#include "gtkselection.h"
#include "gtksignal.h"
#include "gtkwidget.h"
-#include "gtkprivate.h"
#include "config.h"
typedef struct _GtkThemeEnginePrivate GtkThemeEnginePrivate;
#include <stdio.h>
#include "gtkmain.h"
-#include "gtkprivate.h"
#include "gtkwidget.h"
#include "gtkwindow.h"
#include "gtksignal.h"
{
GtkTooltips *tooltips = (GtkTooltips *) data;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
if (tooltips->active_tips_data != NULL &&
GTK_WIDGET_DRAWABLE (tooltips->active_tips_data->widget))
gtk_tooltips_draw_tips (tooltips);
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
GSList *draw_data_list;
GtkWidget *widget;
- GTK_THREADS_ENTER ();
+ GDK_THREADS_ENTER ();
/* Translate all draw requests to be allocation-relative */
widget_list = gtk_widget_redraw_queue;
g_slist_free (gtk_widget_redraw_queue);
gtk_widget_redraw_queue = NULL;
- GTK_THREADS_LEAVE ();
+ GDK_THREADS_LEAVE ();
return FALSE;
}
GtkWidget *label;
GtkWidget *button;
- gtk_threads_enter();
+ gdk_threads_enter();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), name);
{
sprintf(buffer, "%d", counter);
gtk_label_set_text (GTK_LABEL (label), buffer);
- gtk_threads_leave();
+ gdk_threads_leave();
counter++;
/* Give someone else a chance to get the lock next time.
* Only necessary because we don't do anything else while
*/
sleep(0);
- gtk_threads_enter();
+ gdk_threads_enter();
}
gtk_widget_destroy (window);
gtk_main_quit();
pthread_mutex_unlock (&nthreads_mutex);
- gtk_threads_leave();
+ gdk_threads_leave();
return NULL;
}
#ifdef USE_PTHREADS
int i;
- if (!gtk_threads_init())
+ if (!gdk_threads_init())
{
fprintf(stderr, "Could not initialize threads\n");
exit(1);
pthread_mutex_unlock (&nthreads_mutex);
- gtk_threads_enter();
+ gdk_threads_enter();
gtk_main();
- gtk_threads_leave();
+ gdk_threads_leave();
fprintf(stderr, "Done\n");
#else /* !USE_PTHREADS */
fprintf (stderr, "GTK+ not compiled with threads support\n");
GtkWidget *label;
GtkWidget *button;
- gtk_threads_enter();
+ gdk_threads_enter();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), name);
{
sprintf(buffer, "%d", counter);
gtk_label_set_text (GTK_LABEL (label), buffer);
- gtk_threads_leave();
+ gdk_threads_leave();
counter++;
/* Give someone else a chance to get the lock next time.
* Only necessary because we don't do anything else while
*/
sleep(0);
- gtk_threads_enter();
+ gdk_threads_enter();
}
gtk_widget_destroy (window);
gtk_main_quit();
pthread_mutex_unlock (&nthreads_mutex);
- gtk_threads_leave();
+ gdk_threads_leave();
return NULL;
}
#ifdef USE_PTHREADS
int i;
- if (!gtk_threads_init())
+ if (!gdk_threads_init())
{
fprintf(stderr, "Could not initialize threads\n");
exit(1);
pthread_mutex_unlock (&nthreads_mutex);
- gtk_threads_enter();
+ gdk_threads_enter();
gtk_main();
- gtk_threads_leave();
+ gdk_threads_leave();
fprintf(stderr, "Done\n");
#else /* !USE_PTHREADS */
fprintf (stderr, "GTK+ not compiled with threads support\n");